<?php
	header("Content-type:text/html;charset=utf-8");
	
	require_once(dirname(__FILE__).'/'."../Model/ManagerModel.php");	
	require_once(dirname(__FILE__).'/'."../../basic/Controller.php");
	class ManagerController extends Controller{

		function __construct(){
			parent::__construct();
		}

		function staff_form(){
			$this->display();
		}

		function staff_add(){
			
			$data=$_POST;
			$model=new ManagerModel();
			$result=$model->staff_add($data);
			$this->display();
		}

		function staff_edit(){
			$id = $_GET['id'];
			$model=new ManagerModel();
			 $data=$model->staff_edit($id);
			$this->assgin('staff',$data);
 			$this->display();
			//include "manager/staff_edit.php";
		}

		function staff_update(){
			$data=$_POST;
			$model=new ManagerModel();
			$result=$model->staff_update($data);
			$this->assgin('staff',$result);
			$this->display();

		}

		function Dostaff_delete(){
			$id = $_GET['id'];
			$this->assgin('staff',$id);
			$this->display();
		}

		function staff_delete(){
			$id = $_GET['id'];
			$model=new ManagerModel();
			$result=$model->staff_delete($id);	
			$this->display();		
		}

		function staff_search(){
			$model=new ManagerModel();
			$this->display();
		}

		function Dostaff_search(){

			$model=new ManagerModel();
			$data=$model->Dostaff_search();
			$this->assgin('staffs',$data);
			 $this->display();
		}

		function pending(){
			$model=new ManagerModel();
			$data=$model->pending1();
			$data1=$model->pending2();
			$this->assgin('data',$data);
			$this->assgin('pdata',$data1);
			$this->display();
		}

		function staff_Aedit(){
			$id = $_GET['id'];
			$model=new ManagerModel();
			$data=$model->staff_Aedit($id);
			$this->display();
	
		}

		function staff_Dedit(){
			$id = $_GET['id'];
			$model=new ManagerModel();
			$result=$model->staff_Dedit($id);	
			$this->display();
		}

		function Department(){
			$model=new ManagerModel();
			$data=$model->Department();
			$this->assgin('Department',$data);
			//include "index/staff.php";
			$this->display();
		}

		function detail_department(){
			$id=$_GET['id'];
			$model=new ManagerModel();
			$data=$model->detail_department($id);
			$this->assgin('Department',$data);
			//include "index/staff.php";
			$this->display();
		}
	}
?>